# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=source-highlight
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.1.8
pkgrel=1
pkgdesc="Convert source code to syntax highlighted document (mingw-w64)"
arch=('any')
url="https://www.gnu.org/software/src-highlite/"
license=('GPL')
depends=("bash" "${MINGW_PACKAGE_PREFIX}-boost")
#makedepends=("ctags" "${MINGW_PACKAGE_PREFIX}-boost")
source=("https://ftp.gnu.org/gnu/src-highlite/${_realname}-${pkgver}.tar.gz")
sha256sums=('01336a7ea1d1ccc374201f7b81ffa94d0aecb33afc7d6903ebf9fbf33a55ada3')

prepare() {
  cd "$srcdir"/${_realname}-${pkgver}
  autoreconf -fiv
}

build() {
  cd "$srcdir"/${_realname}-${pkgver}
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
  mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --with-boost-libdir=${MINGW_PREFIX}/lib \
    --with-bash-completion=no
  make
}

package() {
  cd "${srcdir}"/build-${CARCH}
  make install DESTDIR="${pkgdir}"

}
